﻿using System;

namespace CSharpExt.CObject
{
    public class CObjectException : Exception
    {
        public CObjectException(String message)
            : base(message)
        {
            
        }
    }

    public class MissingParameterException : CObjectException
    {
        private String _parameterName;
        private String _objectPath;

        public MissingParameterException(CObject co, String parameterName)
            : base(String.Format("Missing parameter {0} in {1}", parameterName, co.Path))
        {
            _parameterName = parameterName;
            _objectPath = co.Path;
        }

        public String Parameter
        {
            get
            {
                return _parameterName;
            }
        }

        public String ObjecPath
        {
            get
            {
                return _objectPath;
            }
        }
    }
}
